import request from '@/utils/request'

const basePath = '/system/role'

export const GetListData = data => {
  return request({
    url: `${basePath}/list`,
    method: 'post',
    data,
  })
}

export const AddData = data => {
  return request({
    url: `${basePath}/add`,
    method: 'post',
    data,
  })
}

export const ModifyData = data => {
  return request({
    url: `${basePath}/modify`,
    method: 'post',
    data,
  })
}

export const DeleteData = data => {
  return request({
    url: `${basePath}/delete`,
    method: 'post',
    data,
  })
}

export const GetAssignedRoles = userId => {
  return request({
    url: `${basePath}/assigned/${userId}`,
    method: 'get',
  })
}

export const AssignRoles = data => {
  return request({
    url: `${basePath}/assign`,
    method: 'post',
    data,
  })
}
